//
//  ViewController.m
//  04 -- QQ动态
//
//  Created by Rainy Zou on 15/11/24.
//  Copyright © 2015年 Rainy Zou. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()


@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    int rows = 0;
    switch (section) {
        case 0:
            rows = 1;
            break;
        case 1:
            rows = 2;
            break;
        case 2:
            rows = 3;
            break;
        default:
            break;
    }
    return rows;
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 3;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *reuseId = @"cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseId];
    if(cell == nil)
    {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseId];
    }
    
    if (indexPath.section == 0) {
        if(indexPath.row ==0){
        [cell.imageView setImage:[UIImage imageNamed:@"found_icons_qzone.png"]];
        cell.textLabel.text = @"QQ空间";

        }
    }
    if(indexPath.section ==1){
        if(indexPath.row == 0){
            [cell.imageView setImage:[UIImage imageNamed:@"found_icons_gamecenter.png"]];
            cell.textLabel.text=@"游戏中心";

        }else{
            [cell.imageView setImage:[UIImage imageNamed:@"found_icons_readcenter.png"]];
            cell.textLabel.text=@"阅读中心";
         }
    }
    if(indexPath.section ==2)
    {
        if(indexPath.row ==0){
            [cell.imageView setImage:[UIImage imageNamed:@"found_icons_folder.png"]];
            cell.textLabel.text=@"文件中心";

        }else if(indexPath.row == 1)
        {
            [cell.imageView setImage:[UIImage imageNamed:@"found_icons_location.png"]];
            cell.textLabel.text=@"附近的人";
          
        }else{
            [cell.imageView setImage:[UIImage imageNamed:@"found_icons_saosao.png"]];
            cell.textLabel.text=@"扫一扫";
            
        }
    }
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    return cell;
}

@end
